home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / javax / swing / DebugGraphicsInfo.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  1.5 KB  |  57 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)DebugGraphicsInfo.java    1.6 98/08/26
  3.  *
  4.  * Copyright 1997, 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package javax.swing;
  16.  
  17. import java.awt.*;
  18. import java.util.*;
  19.  
  20. /** Class used by DebugGraphics for maintaining information about how
  21.   * to render graphics calls.
  22.   *
  23.   * @version 1.6 08/26/98
  24.   * @author Dave Karlton
  25.   */
  26. class DebugGraphicsInfo {
  27.     Color                flashColor = Color.red;
  28.     int                  flashTime = 100;
  29.     int                  flashCount = 2;
  30.     Hashtable            componentToDebug;
  31.     JFrame               debugFrame = null;
  32.     java.io.PrintStream  stream = System.out;
  33.  
  34.     void setDebugOptions(JComponent component, int debug) {
  35.         if (componentToDebug == null) {
  36.             componentToDebug = new Hashtable();
  37.         }
  38.         componentToDebug.put(component, new Integer(debug));
  39.     }
  40.  
  41.     int getDebugOptions(JComponent component) {
  42.         if (componentToDebug == null) {
  43.             return 0;
  44.         } else {
  45.             Integer integer = (Integer)componentToDebug.get(component);
  46.  
  47.             return integer == null ? 0 : integer.intValue();
  48.         }
  49.     }
  50.  
  51.     void log(String string) {
  52.         stream.println(string);
  53.     }
  54. }
  55.  
  56.  
  57.